<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增【请填写功能名称】')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: header('新增仓库')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-store-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">出库时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="outStoreOutDatetime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">客户订单id：</label>
                <div class="col-sm-8">
                    <select class="form-control" id="selorder" name="customerOrderId">
                        <option>--请选择--</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">客户收货时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="outStoreReceiverDatetime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">出库操作员：</label>
                <div class="col-sm-8">
                    <input name="outStorePerson" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">出库状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box">
                        <input type="text" name="outStoreStatus" value="待出库" readonly>
                    </div>
                <label class="col-sm-3 control-label">仓库名称：</label>
                <div class="col-sm-8">
                    <input name="storeName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">仓库类型：</label>
                <div class="col-sm-8">
                    <select name="storeType" class="form-control m-b">
                        <option value="">--请选择--</option>
                        <option value="冷冻仓库">冷冻仓库</option>
                        <option value="水果仓库">水果仓库</option>
                        <option value="其他仓库">其他仓库</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">仓库状态：</label>
                <div class="col-sm-8">
                    <select name="storeState" class="form-control">
                        <option value="">--请选择--</option>
                        <option value="空仓">空仓</option>
                        <option value="满仓">满仓</option>
                        <option value="可用">可用</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">仓库地址：</label>
                <div class="col-sm-8">
                    <input name="storeAddress" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "system/store";
    <script type="text/javascript">
        var prefix = ctx + "system/store"
        $("#form-store-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-store-add').serialize());
            }
        }

        $("input[name='outStoreOutDatetime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='outStoreReceiverDatetime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        //获得待出库的订单
        $(function () {
            $.post("/system/order/findAllZzCustomerOrder",function (result) {
                for (var i in result) {
                    $("#selorder").append("<option value='"+result[i].customerOrderId+"'>"+result[i].customerOrderId+"</option>")
                }
            })
        })
    </script>
</body>
</html>